﻿namespace EFMLEditor
{
    using System;
    using System.Collections.Generic;
    using System.Windows.Forms;

    public class Application
    {
        public static List<Document> Documents = new List<Document>();

        public static List<Document> Strings = new List<Document>();

        public static event OnLoadDelegate Load;

        public static void OnLoad(TreeNode t)
        {
            var handler = Load;
            if (handler != null)
            {
                handler(t);
            }
        }

        public static bool isLoaded { get; set; }

        private static bool isDirty1;

        public static bool isDirty
        {
            get
            {
                return isDirty1;
            }
            set
            {
                isDirty1 = value;
                if (isLoaded)
                {
                    isDirtyChanged(null, null);
                }
            }
        }

        public static event isDirtyEventHandler isDirtyChanged;

        public delegate void isDirtyEventHandler(object sender, EventArgs e);

        public delegate void OnLoadDelegate(TreeNode t);
    }
}